package com.bawei.play

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import javax.annotation.Nonnull

/**
 * 自定义RecyclerView
 */
class VideoRecyclerView constructor(context: Context, attrs: AttributeSet?): RecyclerView(context, attrs) {

    private var isIntercept = false

    fun setIntercept(intercept:Boolean){
        this.isIntercept = intercept
    }

    override fun onInterceptTouchEvent(e: MotionEvent?): Boolean {
        if(this.isIntercept){
            return false
        }
        return super.onInterceptTouchEvent(e)
    }
}